package feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

@FeignClient("account-service")
public interface AccountFeign {
    @GetMapping("/account/{accountCode}")
    Account getByCode(@PathVariable("accountCode") String accountCode);

    @PostMapping("/account/update")
    boolean update(@RequestBody Account Account);

    @PostMapping("/account/insert")
    boolean insert(@RequestBody Account Account);

    @PostMapping("/account/delete")
    boolean delete(@RequestParam("accountCode") String accountCode);

    @PostMapping("/account/reduce")
    boolean reduce(@RequestParam("accountCode") String accountCode, @RequestParam("amount") BigDecimal amount);
}
